package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Application {
    
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
        
        OrderService orderService = context.getBean(OrderService.class);
        
        System.out.println("=== 测试add方法 ===");
        orderService.add("手机", 2);
        
        System.out.println("\n=== 测试delete方法 ===");
        orderService.delete("手机");
        
        System.out.println("\n=== 测试find方法 ===");
        int count = orderService.find("手机");
        System.out.println("查询结果: " + count);
        
        context.close();
    }
}